# -*- coding: utf-8 -*-

from service import Service

class Home(Service):
	""" This service allows for the setting of the home
		position as well as "going home" and docking
	"""
	script = "rev"
	cmd = "nav"

	def __init__(self, robot):
		""" Robot is the robot to control
		"""

		Service.__init__(self, robot)


	def goHome(self):
		""" Sends the robot to the home position
		"""
		return self._sendCommand({"action":12})



	def goHomeAndDock(self):
		""" Sends robot to the dock in order to charge
		"""
		return self._sendCommand({"action":13})


	def updateHomePosition(self):
		""" Sets the current position as the home location
			NOTE: should be in front of dock if you want to
			be able to "go home and dock"
		"""
		return self._sendCommand({"action":14})